﻿#ifndef PLUGINSPEC_H
#define PLUGINSPEC_H
#include "Extensionsystem_Global.h"
#include <QJsonArray>
#include "QString"


namespace CVV
{

namespace Infrastructure
{

namespace ExtensionSystem
{

 namespace Internal {class PluginSpecPrivate;} // Internal
 /**
 * @brief The PluginSpec class
 */
class EXTENSIONSYSTEM_EXPORT PluginSpec
{
public:
     PluginSpec();
    ~PluginSpec();
    enum State { Invalid, Read, Resolved, Loaded, Initialized, Running, Stopped, Deleted };
    /**
     * @brief state
     * 当前插件状态
     * @return
     */
    State state() const;
    /**
     * @brief hasError
     * 是否异常
     * @return
     */
    bool hasError() const;
    /**
     * @brief errorString
     * 异常信息
     * @return
     */
    QString errorString() const;
public:
    static PluginSpec *read(const QString &filePath);
    /**
     * @brief getter setter
     */
    QString name() const;
    void setName(const QString &name);

    QString version() const;
    void setVersion(const QString &version);

    QString compatVersion() const;
    void setCompatVersion(const QString &compatVersion);

    QString description() const;
    void setDescription(const QString &description);

    QString vendor() const;
    void setVendor(const QString &vendor);

    QString copyright() const;
    void setCopyright(const QString &copyright);

    QString license() const;
    void setLicense(const QString &license);

    QString category() const;
    void setCategory(const QString &category);

    /**
     * @brief categoryIcon
     * @return
     */
    QString categoryIcon() const;
    void setCategoryIcon(const QString &icon);

    QString revision() const;
    void setRevision(const QString &revision);

    QString url() const;
    void setUrl(const QString &url);

    QJsonArray params() const;
    void setParams(const QJsonArray &params);

    QJsonArray tempParams() const;
    void setTempParams(const QJsonArray &tempParams);

    QJsonArray outParams() const;
    void setOutParams(const QJsonArray &outParams);

    QJsonArray inputParams() const;
    void setInputParams(const QJsonArray &inputParams);

    QString code() const;
    void setCode(const QString &code);

    QString iconPath() const;
    void setIconPath(const QString &iconPath);


public:
    Internal::PluginSpecPrivate *d;
    friend class Internal::PluginSpecPrivate;



};

}

}

}
#endif // PLUGINSPEC_H
